<!DOCTYPE html>
<html lang="en">
<head>
	<#import "/spring.ftl" as spring/> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>${config.siteName}</title>
    <link href="/assets/images/favicon11.ico" rel="shortcut icon" type="image/x-icon">
    <link href="/assets/plugins/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="/assets/plugins/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="/assets/css/jquery-confirm.min.css" rel="stylesheet">
    <link href="/assets/plugins/fancybox/jquery.fancybox.min.css" rel="stylesheet">
    <link href="/assets/plugins/nprogress/nprogress.css" rel="stylesheet">
    <link href="/assets/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="/assets/plugins/icheck-1.x/skins/square/green.css" rel="stylesheet">
    <link href="/assets/plugins/x-editable-1.5.1/css/bootstrap-editable.css" rel="stylesheet">
    <link href="/assets/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="/assets/plugins/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
    <link href="/assets/plugins/zTree_v3/css/metroStyle/metroStyle.css" rel="stylesheet">
    <link href="/assets/css/yyl.core.css" rel="stylesheet">
</head>
<body class="nav-md">
<div class="container body">
    <div class="main_container">
      
        
        	<div class="panel panel-default">
					<div class="panel-heading">搜索</div>
					<div class="panel-body">
						<form role="form" id="searchForm" class="form-inline">
							
							<div class="form-group">
								<label for="sname1">开始日期</label> 
								<input type='text' class="form-control form_datetime1" required="required" id="workDate" name="workDate" placeholder="请输入日期" />
							</div>
							
							<!-- <div class="form-group">
								<label for="sname1">结束日期</label> 
								 <div class="col-md-6 col-sm-6 col-xs-12">
		                            <input type='text' class="form-control form_datetime1" required="required" id="workDate" name="workDate" placeholder="请输入上班日期" />
		                        </div>
							</div> -->
							
							
							<!-- <div class="form-group">
								<button type="button" id="searchBtn" class="btn btn-default">开始搜索</button>
							</div> -->
							<!-- <div class="form-group">
                                <a href="javascript:;" id="searchware" class="btn btn-default btn-sm"><i class="fa fa-search"></i>查 询</a>
                            </div> -->
						</form>
					</div>
				</div>


		
					<!-- <div class="clearfix"></div> -->
					<div class="row">
					    <div class="col-md-12 col-sm-12 col-xs-12">
					        
					        <div class="x_panel">
					            <div class="x_content">
					                <div class="<#--table-responsive-->">
					                    <table id="tablelist">
					                    </table>
					                </div>
					            </div>
					        </div>
					    </div>
					</div>
				</div>
				</div>
				<script src="/assets/js/jquery-1.11.1.min.js" type="text/javascript"></script>
				<script src="/assets/plugins/bootstrap-3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
				<script src="/assets/js/jquery-confirm.min.js" type="text/javascript"></script>
				<script src="/assets/plugins/fancybox/jquery.fancybox.min.js" type="text/javascript"></script>
				<script src="/assets/plugins/mustache/mustache.min.js" type="text/javascript"></script>
				<script src="/assets/plugins/js-xss/dist/xss.min.js" type="text/javascript"></script>
				<script src="/assets/plugins/nprogress/nprogress.js"></script>
				<script src="/assets/plugins/toastr/toastr.min.js"></script>
				<script src="/assets/plugins/x-editable-1.5.1/js/bootstrap-editable.min.js"></script>
				<script src="/assets/plugins/bootstrap-table/bootstrap-table.min.js"></script>
				<script src="/assets/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
				<script src="/assets/plugins/bootstrap-table/extensions/editable/bootstrap-table-editable.min.js"></script>
				<script src="/assets/plugins/bootstrap-daterangepicker/moment.min.js"></script>
				<script src="/assets/plugins/bootstrap-daterangepicker/daterangepicker.js"></script>
				
				
				</body>
				</html>

    
        <script>
        
   /*      $('#workDate').datetimepicker({
  			 language:  'zh-CN',  
  			 minView: "month",//设置只显示到月份
  		     format: 'yyyy-mm-dd',
            ignoreReadonly: true,
            allowInputToggle: true,
            autoclose:true,//选中关闭
            initialDate:new Date(),
            pickerPosition: "bottom-left"
        }); */
        $('input[name="workDate"]').daterangepicker({
            format: 'YYYY-MM-DD',
            startDate: moment().startOf('month'),
            endDate: moment().endOf('month'),
          ranges: {
		        '今日': [moment().startOf('day'), moment()],
		        '昨日': [moment().subtract('days', 1).startOf('day'), moment().subtract('days', 1).endOf('day')],
		        '最近7日': [moment().subtract('days', 6), moment()],
		        '最近30日': [moment().subtract('days', 29), moment()],
		        '上个月':[moment().month(moment().month() - 1).startOf('month'),moment().month(moment().month() - 1).endOf('month')],
		        '本月':[moment().month(moment().month()).startOf('month'),moment().month(moment().month()).endOf('month')]
		    },
          dateLimit: {
		        days: 30
		  }, //起止时间的最大间隔   
          locale: {
                applyLabel: '确定',
                cancelLabel: '取消',
                fromLabel: '起始时间',
                toLabel: '结束时间',
                customRangeLabel: '手动选择',
                daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
                monthNames: ['一月', '二月', '三月', '四月', '五月', '六月',
                    '七月', '八月', '九月', '十月', '十一月', '十二月'
                ],
                firstDay: 1
            }
        },
        
        function(start, end, label) {
                var opt = {
                        url: "/teacher/sumList",
                        silent: true,
                        query:{
                        	startDate:start.format('YYYY-MM-DD 00:00:00'),
                        	endDate: end.format('YYYY-MM-DD 00:00:00')
                        }
                };
        	$("#tablelist").bootstrapTable('refresh', opt);
        });
        
        var queryParams=function(params) {      
        	var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的         // limit: params.limit,   //页面大小         
        			offset: params.offset,  //页码          
        			pageSize:0,          
        			pageNumber:this.pageNumber,  
        			startDate:moment().startOf('month').format('YYYY-MM-DD 00:00:00') ,//$("#workDate").startDate.val(),
        			endDate: moment().endOf('month').format('YYYY-MM-DD 00:00:00'),//$("#workDate").endDate.val(),
        			length: 6      
        			};      
        	return temp;  
        };
        
   
             $('#tablelist').bootstrapTable({
                    url: "/teacher/sumList",
                    method: 'post',                      //请求方式（*）
                    toolbar: '#toolbar',                //工具按钮用哪个容器
                    striped: true,                      //是否显示行间隔色
                    cache: true,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                    contentType: "application/x-www-form-urlencoded", // 发送到服务器的数据编码类型, application/x-www-form-urlencoded为了实现post方式提交
                    sortable: false,                     //是否启用排序
                    sortOrder: "asc",                   //排序方式
                    sortStable: true,                   // 设置为 true 将获得稳定的排序
                    queryParams: queryParams,//传递参数（*）
                    queryParamsType: '',
                    pagination: true,                   //是否显示分页（*）
                    sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                    pageNumber: 1,                       //初始化加载第一页，默认第一页
                    pageSize: 10000,                       //每页的记录行数（*）
                    pageList: [0],        //可供选择的每页的行数（*）
                    search: false,                       //是否启用搜索框 根据sidePagination选择从前后台搜索
                    strictSearch: false,                 //设置为 true启用 全匹配搜索，否则为模糊搜索
                    searchOnEnterKey: true,            // 设置为 true时，按回车触发搜索方法，否则自动触发搜索方法
                    minimumCountColumns: 1,             //最少允许的列数
                    showColumns: false,                  //是否显示 内容列下拉框
                    showRefresh: false,                  //是否显示刷新按钮
                    showToggle: false,                   //是否显示详细视图和列表视图的切换按钮
                    // detailView: true,                   //是否显示父子表
                    // showExport: true,                   //是否显示导出
                    // exportDataType: "basic",              //basic', 'all', 'selected'.
                    // clickToSelect: true,                //是否启用点击选中行
                    // singleSelect: true,
                    height: $(window).height() - 178,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                    rowStyle: function (row, index){return { 'classes': '' };},
                    columns: [{
                        checkbox: true
                    }, {
                        field: 'teaName',
                        title: '老师编号',
                        visible :false,
                        editable: false
                    }, {
                        field: 'childId',
                        title: '孩子ID',
                        visible :false,
                        editable: false
                    }, {
                        field: 'courseId',
                        title: '课程ID',
                        visible :false,
                        editable: false
                    }, {
                        field: 'inOuter',
                        title: '孩子类别',
                        visible :false,
                        editable: false,
                        formatter: function (code) {
                        	if(code==0){
                        		return "内部孩子";
                        	}else if(code==1){
                        		return "外部孩子";
                        	}else{
                        		return "未知";
                        	}
                        }
                    }, {
                        field: 'nickName',
                        title: '老师名',
                        editable: false
                    }, {
                        field: 'levelName',
                        title: '老师级别',
                        visible :true,
                        editable: false
                    }, {
                        field: 'cntDate',
                        title: '上班天数',
                        editable: false
                    }, {
                        field: 'cntWorkDateCourse',
                        title: '工作日上课数',
                        editable: false
                    }, {
                        field: 'cntHolidayCourse',
                        title: '休息日上课数',
                        editable: false
                    }, {
                        field: 'cntCourse',
                        title: '上课数',
                        editable: false
                    }, {
                        field: 'totalPrice',
                        title: '汇总金额',
                        editable: false
                    }]
                });
             
            
    </script>
